<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    var a = 1;
    function fun1() {
      var a = 2;
      function fun2() {
        var a = 3;
        console.log(a);//3
      }
    }
  </script>
</html>
